<?php $this->load->module('mobile/index/header', $common);?>
<style>
    #list a{display:block}
    .city img{width:5%}
    .city-around{display:none}
    .city .city-choice{width:100%}
    .rmjdlist a{color:#333!important;}
</style>
<div class="wrap" >
    <!-- Swiper*slider*start -->
    <div class="swiper-container">
            <?php
                $TEMPLATE = <<<HTML
<div class="swiper-wrapper ticket-banner-wrap">
{listinfo}
<div class="swiper-slide"><a title="{title}" href="{link}" ><img alt="{title}" style="width:100%" src="{pic}"></a></div>
{/listinfo}
</div>
<div class="swiper-pagination"></div>
HTML;
                ?>
            <?php  diy('scenery_index_01', 'imagelist', $TEMPLATE, 1, '<div class="swiper-slide"><img src="img/ticketslider.jpg"></div>');?>
    </div>
    <div class="container">
    <div class="blank5"></div>
    <div class="jdsearch">
        <form action="" method="post" id="searchForm" onsubmit="$('.search_btn').trigger('click');return false;">
            <input type="text" id="search_name" autocomplete="off" placeholder="输入景点名/城市/关键字...">
            <a href="javascript:void(0)" class="search_btn"></a>
        </form>
    </div>
    </div>
    <div class="blank5"></div>
    <div class="container">
        <div class="city">
            <div class="city-choice">
                <a href="<?php echo site_url('mobile/scenery/ticketcity/?p='.$_GET['p'].'&c='.$_GET['c'])?>" style="color:#333">
                <img src="img/city.png" data-original="img/city.png">
                <span>城市选择</span>
                </a>
            </div>
            <div class="city-around">
                <img src="img/zbjd.png" data-original="img/zbjd.png">
                <span>周边景点</span>
            </div>
        </div>
        <div class="rmjd">
            <div class="rmjdbar">
                <img src="img/rmjdbar.png" data-original="img/rmjdbar.png">
            </div>
            <div class="rmjdlist">
                <ul  id="js-list-wrap">
                    <?php if($datalist){?>
                    <?php foreach ($datalist as $v) {?>
                    <li>
                        <a href="<?php echo $v['link']?>">


                            <div class="rmxllsit-1">
                        <div class="rmxllsit-img">

                            <img class="lazy" src="<?php echo URLPRE;?>static/public/images/nophoto.jpg" onerror="this.error=null;this.src='<?php echo URLPRE;?>static/public/images/nophoto.jpg'" data-original="<?php echo $v['file_url'];?>" alt="<?php echo $v['scenic_name'];?>">
                        </div>
                        <div class="rmxllsit-txt">
                            <ul>
                                <li><p>[<?php echo $v['scenic_name'];?>]</p></li>
                                <li><small><?php echo mb_substr($v['description'], 0, 20);?></small></li>
                                <li>
                                     <span class="sort"></span>
                                     <span><?php if (!empty($v['price'])) :?>
                                         ¥<?php echo $v['price'];?><small>起</small>
                                         <?php else :?>
                                         暂无价格
                                         <?php endif ;?></span>
                                </li>
                                <li>￥<?php echo $v['display_price'];?></li>
                                <li><span>已有<i><?php echo $v['views'];?></i>人浏览</span>

                                    <span class="paybtn"> <?php echo (!empty($v['price']))?'立即预定':'电询';?></span>

                                </li>
                            </ul>
                        </div>
                    </div>

                        <!--<div class="rmjdlist1">
                            <div class="rmjdlist-img">
                                <img src="<?php /*echo $v['file_url'];*/?>" onerror="this.error=null;this.src='<?php /*echo URLPRE;*/?>static/public/images/nophoto.jpg'">
                            </div>
                            <div class="rmjdlist-txt">
                                <ul>
                                    <li><p><?php /*echo $v['scenic_name'];*/?></p></li>
                                    <li><small><?php /*echo mb_substr($v['description'], 0, 20);*/?></small></li>
                                    <li><span><?php /*if (!empty($v['price'])) :*/?>
                                                ¥<?php /*echo $v['price'];*/?><small>起</small>
                                            <?php /*else :*/?>
                                                电询
                                            <?php /*endif ;*/?></span></li>
                                    <li><span><small style="text-decoration:line-through;font-weight: bold;">￥<?php /*echo $v['display_price']*/?></small></span></li>
                                    <li><small>已有<i><?php /*echo $v['views']*/?></i>人浏览</small><img class="yd" src="img/ydbtn.png" data-original="img/ydbtn.png"></li>
                                </ul>
                            </div>
                        </div>-->
                        <div class="line"></div>
                        </a>
                    </li>
                    <?php }?>
                    <?php }else{?>
                        <li>
                            <div class="rmjdlist1">抱歉，没有找到符合条件的门票。</div>
                        </li>
                    <?php }?>
                </ul>
            </div>
        </div>
        <?php if($datalist){?><a href="javascript:;" class="btn-grey btn" id="js-load-more">加载更多</a>
        <?php }?>
    </div>
</div>
<script type="text/javascript" src="js/modernizr.custom.js"></script>
<script type="text/javascript" src="js/jquery.dlmenu.js"></script>
<script src="js/swiper.3.1.2.min.js"></script>
<script>
    $(function(){
        $( '#dl-menu' ).dlmenu();
    });
    //dl下拉菜单
</script>
<script>
    var mySwiper = new Swiper ('.swiper-container', {
        loop: true,
        autoplay: 3000,//可选选项，自动滑动

        // 如果需要分页器
        pagination: '.swiper-pagination',
        // 如果需要前进后退按钮
        // nextButton: '.swiper-button-next',
        //prevButton: '.swiper-button-prev',
        // 如果需要滚动条
       // scrollbar: '.swiper-scrollbar'
    })
</script>

    <script type="text/javascript">
        $(function(){
            var slid = $("#sliderimg").slider({
                loop: true
            });
            var page = <?php echo $page+1;?>;
            var keyword = '<?php echo $_GET['keyword']?>';
            var p = '<?php echo intval($_GET['p'])?>';
            var c = '<?php echo intval($_GET['c'])?>';
            var url = '<?php echo site_url('mobile/scenery/index');?>';


            $(window).scroll(function(){

                totalheight = parseFloat($(window).height()) + parseFloat($(window).scrollTop());
                if($(document).height() <= totalheight) {
                    var $js_load_more = $('#js-load-more');
                    $js_load_more.text('加载中...');
                    $.get(url + (url.indexOf('?') != -1 ? '&' : '/?') + 'isajax=1&p=' + p + '&c=' + c + '&keyword=' + keyword + '&page=' + page, function (data) {
                        if (data.length > 0) {
                            var html = '';
                            for (var i = 0; i < data.length; i++) {
                                var l = data[i];
                                var price = '电询';
                                var btn_string = '电询';
                                if (l.price!==null) {
                                    price = '¥' + l.price + '<small>起</small>';
                                    btn_string = '立即预定';
                                }

                                 html += '<div class="rmxllsit"><ul><li><a href="'+l.link+'" class="cl">'+
                                    '<div class="rmxllsit-1">'+
                                    '<div class="rmxllsit-img">'+
                                    '<img class="lazy" src="'+l.file_url+'" onerror="this.error=null;this.src='+l.file_url+'" alt="'+l.scenic_name+'" style="display:inline;">'+
                                    '</div><div class="rmxllsit-txt">'+
                                    '<ul><li><p>['+l.scenic_name+']</p></li>'+
                                    '<li><small>'+l.description+'</small></li>'+
                                    '<li><span class="sort"></span><span>'+price+'</span></li>'+
                                    '<li>￥'+l.display_price+'</li>'+
                                    '<li><span>已有<i>'+l.views+'</i>人浏览</span><span class="paybtn">'+btn_string+'</span></li></ul>'+
                                    '</div></div></a><div class="line"></div></li></ul></div>';

                            }
                            $('#js-list-wrap').append(html);
                            page++;
                            $js_load_more.text('加载更多');
                        } else {

                            $.dialog({
                                style: 'tip',
                                width: 200,
                                closeTime: 1000,
                                content: '<p style="text-align: center">没有更多了</p>'
                            }).open();
                            $js_load_more.text('没有更多了');
                        }

                    }, 'json');
                }
            });
            $('.search_btn').click(function () {
                keyword = $('#search_name').val();
                if(keyword.length> 0){
                    keyword = encodeURIComponent(keyword);
                    window.location.href = url+(url.indexOf("?") > -1 ? "&" : "?")+'keyword='+keyword;
                }
            });
        });
    </script>
<?php $this->load->module('mobile/index/footer', $common);?>